package com.g0dkar.leet.core.rest.actions;

import java.util.Collection;

import javax.servlet.http.HttpServletRequest;
import javax.validation.ConstraintViolation;

import br.com.caelum.vraptor.Path;
import br.com.caelum.vraptor.Resource;
import br.com.caelum.vraptor.Result;

import com.g0dkar.leet.core.Leet;

/**
 * This controller handles validations for the client.
 * @author g0dkar
 *
 */
@Resource
@Path("/api")
public class ValidationController extends AbstractRestAction {
	
	public ValidationController(Leet application, Result result, HttpServletRequest request) {
		super(application, result, request);
	}

	@Path({ "{_mappingName:[a-zA-Z_][a-zA-Z0-9_]*}/validate.{_format}", "{_mappingName:[a-zA-Z_][a-zA-Z0-9_]+}-{_prefix:[a-zA-Z_][a-zA-Z0-9_]*}/validate.{_format}" })
	public Collection<ConstraintViolation<Object>> validateEntity(String _mappingName, String _format) {
		Collection<ConstraintViolation<Object>> collection = null;
		
		if (application != null && application.hasClassMapping(_mappingName)) {
			
		}
		
		return collection;
	}
}
